-
Notifications
You must be signed in to change notification settings - Fork 7
Add docs for server-level auth #583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| "providing-useful-tool-errors": "Providing useful tool errors", | ||
| "retry-tools-with-improved-prompt": "Retry tools with improved prompt", | ||
| "call-tools-from-mcp-clients": "Call tools from MCP clients", | ||
| "secure-your-mcp-server": "Secure Your MCP Server with OAuth", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to pull in main and merge this with https://docs.arcade.dev/en/home/serve-tools/securing-arcade-mcp
| import { Steps, Tabs, Callout } from "nextra/components"; | ||
|
|
||
| # Adding Resource Server Authentication to Your MCP Server | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rather technical - I think we should start with something a little higher level (so... you want to deploy this thing, but need to protect it...). I think you can steal from https://docs.arcade.dev/en/home/serve-tools/securing-arcade-mcp
| Resource Server authentication solves this by: | ||
|
|
||
| 1. **Authenticating every request** - Validates the Bearer token before processing any MCP messages | ||
| 2. **Extracting user identity** - The token's `sub` claim becomes the `context.user_id` for tool execution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
|
|
||
| 1. **Authenticating every request** - Validates the Bearer token before processing any MCP messages | ||
| 2. **Extracting user identity** - The token's `sub` claim becomes the `context.user_id` for tool execution | ||
| 3. **Enabling secure tools** - Tools requiring authorization or secrets can now safely execute over HTTP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 3. **Enabling secure tools** - Tools requiring authorization or secrets can now safely execute over HTTP | |
| 3. **Enabling secure tools** - Tools requiring authorization or secrets can now safely execute over HTTP - but authenticated tools will still require authenticating to the downstream service |
| resource_server = ResourceServer( | ||
| canonical_url="http://127.0.0.1:8000/mcp", | ||
| authorization_servers=[ | ||
| AuthorizationServerEntry( | ||
| authorization_server_url="https://your-workos.authkit.app", | ||
| issuer="https://your-workos.authkit.app", | ||
| jwks_uri="https://your-workos.authkit.app/oauth2/jwks", | ||
| algorithm="RS256", | ||
| # Authkit doesn't set the aud claim as the MCP server's canonical URL | ||
| validation_options=AccessTokenValidationOptions( | ||
| verify_aud=False, | ||
| ), | ||
| ) | ||
| ], | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not so bad at all!
| # Server-Level vs Tool-Level Authorization | ||
|
|
||
| Arcade MCP servers support two distinct layers of authorization that work together to provide comprehensive security. Understanding the difference is crucial for building secure, production-ready MCP servers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page is a very good idea!
| <Tabs items={["ResourceServer (Recommended)", "JWKSTokenValidator (Simple)"]}> | ||
| <Tabs.Tab> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to talk about how things work when you arcade deploy too - in that we handle all of this for you (always be selling). Can arcade deploy be the first tab?
| | **Required for** | HTTP servers in production | Tools that access user data from APIs | | ||
| | **Configuration** | `MCPApp(auth=resource_server)` | `@app.tool(requires_auth=GitHub(...))` | | ||
|
|
||
| ## Resource Server Authentication (Server-Level) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, talk about how if you arcade deploy, we handle this all for you
Documentation for ArcadeAI/arcade-mcp#696
Two new pages:
Update one page:
Note
Adds docs and examples for securing HTTP MCP servers with OAuth 2.1 resource server auth, clarifies server- vs tool-level auth, and updates navigation and securing guide.
app/en/home/build-tools/secure-your-mcp-server/page.mdx:ResourceServer, multipleAuthorizationServerEntry, env var config, andJWKSTokenValidator.app/en/home/build-tools/server-level-vs-tool-level-auth/page.mdx:app/en/home/serve-tools/securing-arcade-mcp/page.mdxto add OAuth Resource Server Authentication section and link to the new guide.app/en/home/build-tools/_meta.tsxto addsecure-your-mcp-serverandserver-level-vs-tool-level-authentries.Written by Cursor Bugbot for commit bbbc0fd. This will update automatically on new commits. Configure here.